<?php defined( '_VALID_MOS' ) or die( 'Restricted access' );?>
<?php
global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $message_login, $my;

if (file_exists( $mosConfig_absolute_path.'/components/com_jcs/languages/'.$mosConfig_lang.'.php' ))
    include( $mosConfig_absolute_path.'/components/com_jcs/languages/'.$mosConfig_lang.'.php' );
else
    require( $mosConfig_absolute_path.'/components/com_jcs/languages/english.php' );
$itemid = mosGetParam($_REQUEST, 'Itemid');
?>

<table class="contentpaneopen" width="100%">
  <TR>
    <td class="contentheading">
    <?php echo $JCS_HISTORY;?>
    </td>
  </TR>
</table>
<table class="contentpaneopen" width="100%">
  <TR>
    <td>
      <P><a href="<?php echo sefRelToAbs('index.php?option=com_jcs&amp;task=add&amp;Itemid='.$itemid); ?>"><?php echo $JCS_NEW?></a></P>
<?php 
if($msg) echo "<p><h3>$msg</h3></p>";

if($_SESSION['jcs_access_url']) printf( "<P>%s</P>", sprintf(JCS_ACCESS_PAGE, $_SESSION['jcs_access_url']));

if($finish) echo "<p>$finish</p>";
 ?>
      <?php
      if(count($rows) > 0)
      {
      ?>
          <TABLE border="0" width="100%" cellpadding="2" cellspacing="0">
            <TR class="sectiontableheader">
              <Th width="1%">#</Th>
              <Th><?php echo JCS_SUBCSR_T ?></Th>
              <Th><?php echo JCS_LIMIT_T ?></Th>
              <Th><?php echo JCS_USED_T ?></Th>
              <Th><?php echo JCS_ACTIVE_T ?></Th>
              <Th><?php echo JCS_DAYS_T ?></Th>
              <Th><?php echo JCS_START_T ?></Th>
              <Th><?php echo JCS_END_T ?></Th>
              <Th><?php echo JCS_PRICE_T ?></Th>
            </TR>
            <?php
            $k=0;
            foreach ($rows AS $row)
            {
            ?>
            <TR class="sectiontableentry<?php echo ($k + 1);?>" align="center">
                    <TD><?php echo $row->id;?></TD>
                    <TD><?php echo $row->name;?></TD>
                    <TD><?php echo $row->access_limit ? $row->access_limit : "No Limit";?></TD>
                    <TD><?php echo $row->access_count;?> Times</TD>
                    <TD><img src="components/com_jcs/s<?php echo $row->published;?>.png" alt=""></TD>
                    <TD><?php if($row->days >= 0)echo $row->days; else echo '0';?></TD>
                    <TD><?php echo $row->ctime;?></TD>
                    <TD><?php echo $row->extime;?></TD>
                    <TD><?php echo JEConfig::get('general.curr') ?> <?php echo $row->price;?> </TD>
                </TR>
                <?php
            $k = 1 - $k;
            }
                ?>
            </TABLE>
		<?php 
      }
      else 
      {
      	echo $JCS_NOSUBSCR;
      }
		?>
            </td>
  </TR>
</table>
